home *** CD-ROM | disk | FTP | other *** search
- Path: doors.informatik.uni-siegen.de!plrunu
- From: plrunu@informatik.uni-siegen.de (Runu Knips)
- Newsgroups: comp.lang.c++
- Subject: Re: ?Callbacks / Pointer to member functions?
- Date: 15 Mar 1996 12:49:38 GMT
- Organization: University of Siegen
- Sender: plrunu@doors.informatik.uni-siegen.de (Runu Knips)
- Distribution: world
- Message-ID: <4ibp12$br5@si-nic.hrz.uni-siegen.de>
- References: <4i9b3s$7tt@serveru1.naic.wpafb.af.mil>
- NNTP-Posting-Host: doors.informatik.uni-siegen.de
- Keywords: Callbacks Pointers Member Functions
-
-
- Motif is C. C doesn't know about classes. If you want
- to declare a member function with may be called by
- C functions, you have to declare it the following
- way:
-
- class X {
- ....
- static void Func (void);
- ....
- };
-
- The 'static' says 'this function doesn't have a
- this pointer'. It is a member function which doesn't
- know by which class instance it is owned.
-
- Therefore, if this object should be reusable, you
- should store in each Motif-Button (or Window or
- else) the this-pointer to the corresponding C++-
- Object, so you may get it out of the parameters
- (I hope the callback function will get the
- button as parameter!) of the callback function.
-